#include <cstdio>

int main( )
{
    int t, cas = 1, n, m, d, min;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d", &n, &m);
        min = 0x7fffffff;
        while ( m-- )
        {
            scanf("%d", &d);
            if ( min > d ) min = d;
        }
        if ( ( n / min ) % 2 == 0 )
            printf("Case #%d: Alice\n", cas++);
        else
            printf("Case #%d: Bob\n", cas++);
    }
    return 0;
}
